Page({
  onLoad({ id }) {
    this.getVisitor(id)
  },
  //查询访客邀请详情
  async getVisitor(id) {
    const res = await wx.http.get(`/visitor/${id}`)
    this.setData({
      ...res.data
    })

  },
  onShareAppMessage() {
    return {
      title: '查看通行证',
      path: '/visitor_pkg/pages/passport/index',
      imageUrl: 'https://enjoy-plus.oss-cn-beijing.aliyuncs.com/images/share_poster.png',
    }
  },
  //保存图片
  async saveImage() {
    const { path } = await wx.getImageInfo({
      src: this.data.url
    })
    await wx.saveVideoToPhotosAlbum({
      filePath: path
    })
  }
})
